﻿namespace BackOffice.Context.UltiPro.BackOfficeUIMapClasses
{
    using Microsoft.VisualStudio.TestTools.UITesting.WinControls;
    using System;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Windows.Input;
    using System.CodeDom.Compiler;
    using System.Text.RegularExpressions;
    using Microsoft.VisualStudio.TestTools.UITest.Extension;
    using Microsoft.VisualStudio.TestTools.UITesting;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard;
    using Mouse = Microsoft.VisualStudio.TestTools.UITesting.Mouse;
    using MouseButtons = System.Windows.Forms.MouseButtons;
    using System.Configuration;
    using System.Data.SqlClient;
    using System.Linq;
    using System.Xml.Linq;
    using System.Xml;
    using System.Diagnostics;

    public partial class BackOfficeUIMap
    {
        public BackOfficeUIMap()
        {
        }

        #region Custom Controls

        /// <summary>
        /// Get CompanyTreeItemByCompanyName
        /// </summary>
        /// <param name="companyName">Name of the company.</param>
        /// <returns></returns>
        public WinTreeItem UICompanyTreeItem(string companyName)
        {
            WinTreeItem companyTreeItem = new WinTreeItem(this.UISelectacompanyWindow.UIItemWindow.CompanySelectorItemTree.UIMerrillsCalendarCompTreeItem);

            companyTreeItem.SearchProperties[WinTreeItem.PropertyNames.Name] = companyName;
            companyTreeItem.SearchProperties["Value"] = "1";
            companyTreeItem.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            companyTreeItem.SearchConfigurations.Add(SearchConfiguration.NextSibling);
            companyTreeItem.WindowTitles.Add("Select a company...");

            return companyTreeItem;
        }

        /// <summary>
        /// Get the context menu item.
        /// </summary>
        /// <param name="menuItemText">The menu item text.</param>
        /// <returns></returns>
        public WinMenuItem UIContextMenuItem(string menuItemText)
        {
            WinMenuItem mUIContextMenuItem = new WinMenuItem(this.UIULTIPROWindow.UIStandardPayDataEntryWindow);
                #region Search Criteria
                mUIContextMenuItem.SearchProperties[WinMenuItem.PropertyNames.Name] = menuItemText;
                #endregion
            
            return mUIContextMenuItem;
        }

        #endregion
    }
}
